bitkeeper revision 1.1159.12.2 (4117f3b8rwM8OBu0SxwoWkvUXsjLTQ)
authoriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Mon, 9 Aug 2004 21:59:20 +0000 (21:59 +0000)
committeriap10@labyrinth.cl.cam.ac.uk <iap10@labyrinth.cl.cam.ac.uk>
Mon, 9 Aug 2004 21:59:20 +0000 (21:59 +0000)
add migration support to ngio frontend blk driver.

BitKeeper/etc/ignore
linux-2.6.7-xen-sparse/drivers/xen/blkfront/blkfront.c
tools/libxc/xc_linux_restore.c
tools/libxc/xc_linux_save.c

index 8ad837b7f064b011405c95d5f47b9cae407f5993..c548c71ccafc0582775519d9cb8b4d672255d001 100644 (file)
@@ -16,9 +16,11 @@ docs/*.aux
 docs/*.log
 docs/*.pdf
 docs/*.ps
+docs/*.dvi
 docs/*.toc
 docs/interface/*
 docs/user/*
+docs/xend/*
 extras/mini-os/h/hypervisor-ifs
 install
 install/*
@@ -51,4 +53,3 @@ xen/tools/figlet/figlet
 xen/xen
 xen/xen-syms
 xen/xen.*
-xen/common/sched_atropos.c.smh
index 848b940b2e568a0f5951586cdfc65ef1967f6ad2..59f5e12d68b3956c2bdb17df2fa18f7944bce262 100644 (file)
@@ -303,6 +303,26 @@ static void kick_pending_request_queues(void)
 }
 
 
+/* Upon block read completion, issue a dummy machphys update for the
+pages in the buffer, just in case we're being migrated. */
+
+static void blkif_read_completion(struct request *req)
+{
+       struct bio *bio;
+       struct bio_vec *bvec;
+       int idx;
+       unsigned long mfn, pfn
+
+       rq_for_each_bio(bio, req) {
+               bio_for_each_segment(bvec, bio, idx) {
+                   mfn = page_to_phys(bvec->bv_page)>>PAGE_SHIFT;
+                   pfn = machine_to_phys_mapping[mfn];
+                   queue_machphys_update(mfn, pfn);
+               }
+       }
+}
+
+
 static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs)
 {
        struct request *req;
@@ -334,6 +354,9 @@ static irqreturn_t blkif_int(int irq, void *dev_id, struct pt_regs *ptregs)
                                BUG();
 
                        end_that_request_last(req);
+
+                       if( bret->operation == BLKIF_OP_READ )
+                           blkif_read_completion( req );
                        break;
                 case BLKIF_OP_PROBE:
                         memcpy(&blkif_control_rsp, bret, sizeof(*bret));
index f091914dba099081a6b5c99f5e48afa644de4d4a..db21621e55c15eb06962f795762d321e61b1e314 100644 (file)
@@ -214,7 +214,8 @@ int xc_linux_restore(int xc_handle, XcIOContext *ioctxt)
     if ( xc_domain_setinitialmem(xc_handle, dom, 
                                  nr_pfns * (PAGE_SIZE / 1024)) )
     {
-        xcio_error(ioctxt, "Could not set domain initial memory");
+        xcio_error(ioctxt, "Could not set domain %d initial memory. pfns=%d, %dKB",
+                  dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
         goto out;
     }
 
index 26abf632ae981bc443aac0bdfa2c0e647d4d9c40..c2482ef2b17dddb0f811b2c93a1c38a1c64be31f 100644 (file)
@@ -632,7 +632,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
                 pfn_batch[batch] = n;
                 pfn_type[batch] = live_pfn_to_mfn_table[n];
 
-                if( pfn_type[batch] == 0x80000004 ){
+                if( pfn_type[batch] == 0x80000001 ){
                     /* not currently in pusedo-physical map -- set bit
                        in to_fix that we must send this page in last_iter
                        unless its sent sooner anyhow */